﻿using BarManager.Core.BusinessRules.Interfaces.Validator;
using BarManager.Core.BusinessRules.Specification;
using BarManager.Core.DomainService;
using BarManager.Core.Entity;

namespace BarManager.Core.BusinessRules.Validator
{
    public class CategoriaValidator : BaseValidator<Categoria>, ICategoriaValidator
    {
        public CategoriaValidator(ICategoriaRepository repository)
        {
            Rules.Add(new Rule<Categoria>(ValidatorType.Add, new CategoriaAddSpecification(repository)));
            Rules.Add(new Rule<Categoria>(ValidatorType.Update, new CategoriaAddSpecification(repository)));
            Rules.Add(new Rule<Categoria>(ValidatorType.Delete, new CategoriaDeleteSpecification(repository)));
        }
    }
}
